This repository was archived by the owner on Apr 18, 2025. It is now read-only.
NW6 | Pedram Amani | Module-JS1 | Week3#186
Open
pedram-am wants to merge 7 commits intoCodeYourFuture:mainfrom
Open
NW6 | Pedram Amani | Module-JS1 | Week3#186pedram-am wants to merge 7 commits intoCodeYourFuture:mainfrom
pedram-am wants to merge 7 commits intoCodeYourFuture:mainfrom
Conversation
bunday
suggested changes
Dec 9, 2023
| const minutes = Number(time.slice(3)); | ||
|
|
||
| if (hours >= 12) { | ||
| const formattedHoursAfternoon = |
There was a problem hiding this comment.
there is a concept called Do not Repeat Yourself (DRY) it is a concept where you write a code once and you reuse it, instead of rewritten the same code again, you can read more about. formattedHoursAfternoon and formattedHoursMorning have a couple of common code, can you think of a way to extract that into a reusable function?
| // When the angle is greater than 180 degrees and less than 360 degrees, | ||
| // Then the function should return "Reflex angle" | ||
|
|
||
| function getAngleType(angle) { |
There was a problem hiding this comment.
what happens when the angle passed is less than 0 ?
|
|
||
| // These acceptance criteria cover a range of scenarios to ensure that the isProperFraction function handles both proper and improper fractions correctly and handles potential errors such as a zero denominator. | ||
|
|
||
| function isProperFraction(numerator, denominator) { |
areebsattar
reviewed
Feb 19, 2024
| console.log(isValidTriangle(3, 4, 5)); | ||
| console.log(isValidTriangle(1, 1, 3)); | ||
| console.log(isValidTriangle(-2, 2, 5)); | ||
| console.log(isValidTriangle(7, "apple", 5)); |
Contributor
There was a problem hiding this comment.
Good implementation with multiple examples
| return "Obtuse angle"; | ||
| } else if (angle === 180) { | ||
| return "Straight angle"; | ||
| } else if (angle > 180 && angle < 360) { |
Contributor
There was a problem hiding this comment.
I have learned that we can use if statements again and again rather that else if, I have had quite a lot of issues using else if in few code blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
JavaScript 1 - Week 3 exercises
Questions
Ask any questions you have for your reviewer.